#!/usr/bin/perl

# Read gene length
my $size=$ARGV[0];
if (! defined($size)) {
	print "USAGE: generate-gene <length>";
	exit(1);
}

# Generate random digits (probability 0.5)
my $digits = int($size / 4) + 1;
while ($digits > 0) {
	# Generate digit
	my $digit = int(rand(16));
	print chr(($digit < 10 ? 48 : 87) + $digit);
	--$digits;
}

# Exit 
exit(0)

